package com.atguigu.tingshu.album.mapper;

import com.atguigu.tingshu.model.album.TrackInfo;
import com.atguigu.tingshu.query.album.TrackInfoQuery;
import com.atguigu.tingshu.vo.album.AlbumTrackListVo;
import com.atguigu.tingshu.vo.album.TrackListVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface TrackInfoMapper extends BaseMapper<TrackInfo> {


    /**
     * 查询当前用户声音分页列表
     *
     * @param trackListVoPage
     * @param trackInfoQuery
     * @return
     */
    Page<TrackListVo> selectAlbumTrackPage(Page<TrackListVo> trackListVoPage, @Param("trackInfoQuery") TrackInfoQuery trackInfoQuery);

    /**
     * 删除声音-更新order_num的值
     *
     * @param albumId
     * @param orderNum
     */
    void updateOrderNum(@Param("albumId") Long albumId, @Param("orderNum") Integer orderNum);

    /**
     * 查询专辑声音分页列表
     *
     * @param trackListVoPage
     * @param albumId
     * @return
     */
    Page<AlbumTrackListVo> getAlbumTrackPage(Page<AlbumTrackListVo> trackListVoPage, @Param("albumId") Long albumId);

    /**
     * 根据trackId和statType更新count
     *
     * @param trackId
     * @param statType
     * @param count
     */
    void updateTrackStat(@Param("trackId") Long trackId, @Param("statType") String statType, @Param("count") Integer count);
}
